import request from "@/utils/request";
import { FillActFrom, FillManagementForm } from "@/api/fill/management/Types";
import { FillDTO } from "@/api/fill/business/Types";
import { AxiosPromise } from "axios";
import { OssVO } from "@/api/system/oss/types";

//列表显示全部
export const getListManageAll = (data?: FillDTO) => {
  return request({
    url: "/fill-manage/getListAll",
    method: "post",
    data: data
  });
};

//下达数据列表
export const getListIssueAll = (data?: FillDTO) => {
  return request({
    url: "/fill-manage/getListIssueAll",
    method: "post",
    data: data
  });
};
//添加列表显示
export const getListManage = (data: any) => {
  return request({
    url: "/fill-manage/getList",
    method: "post",
    data: data
  });
};

//保存或编辑
export const saveOrUpdateNew = (data?: FillManagementForm) => {
  return request({
    url: "/fill-manage/saveOrUpdateNew",
    method: "post",
    data: data
  });
};

//提交
export const submitAll = (data?: FillActFrom) => {
  return request({
    url: "/fill-manage/submitAll",
    method: "post",
    data: data
  });
};

//上传文件
export const uploadFile = (data?: any) => {
  return request({
    url: "/fill-manage/uploadFile",
    method: "post",
    data: data
  });
};

/**
 * 查看文件
 * @param id
 */
export const getFile = (id: any): AxiosPromise<OssVO> => {
  return request({
    url: "/fill-manage/getFile/" + id,
    method: "get",
    params: id
  });
};
//删除文件
export const deleteFile = (ossId?: any) => {
  return request({
    url: "/fill-manage/deleteFile/" + ossId,
    method: "get",
    params: ossId
  });
};
/**
 * 查询归口统计的申请列表
 * @param query
 */
export const getApplyList = (query?: any) => {
  return request({
    url: "/fill-manage/getApplyList",
    method: "post",
    data: query
  });
};
/**
 * 查询详情
 * @param id
 */
export const getFillActManageDetail = (id?: any) => {
  return request({
    url: "/fill-manage/getById/+" + id,
    method: "get",
    params: id
  });
};

/**
 * 校验是否提交
 * @param data
 */
export const verify = (data?: FillDTO) => {
  return request({
    url: "/fill-manage/verify",
    method: "post",
    data: data
  });
};
